home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 July
/
EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso
/
earkit
/
news
/
thor
/
hd-install
/
thor25_arexx.lha
/
BBSRead
/
AddFileList.br
next >
Wrap
Text File
|
1995-09-06
|
2KB
|
112 lines
/* AddFileList.br
*
* Arexx script to add a FLIM ABBS file list to the database.
*/
options results
/* trace results */
parse arg argument
template = 'BBSNAME/A,FILENAME/A'
if(argument = '' | argument = '?') then
do
say '$VER: AddFileList.br V4.1 (2.7.95)'
say 'Template:' template
exit
end
if ~show('p', 'BBSREAD') then do
address command
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
"WaitForPort BBSREAD"
end
address BBSREAD
READARGS template ARGS CMDLINE argument
if(rc ~= 0) then
do
say BBSREAD.LASTERROR
exit
end
if(~OPEN(fh,ARGS.FILENAME,'Read')) then
do
say 'Unable to open file'
exit
end
farea = ''
rc = 0
signal on ERROR
signal on BREAK_C
signal on HALT
BUFMODE COPYBACK /* Enable copyback buffer mode */
do until eof(fh)
aline = readln(fh)
if(left(aline, 21) = 'Listing of directory ') then
do
farea = '"' || strip(substr(aline, 22),'T',':') || '"'
say '0A'x || '(' || strip(farea,'B', '"') || ')'
CONFIGFAREA '"' || ARGS.BBSNAME || '"' farea
end
else
do
if farea ~= '' then
do
aline = substr(aline,3)
parse var aline fname fdate fsize fdnls fdescr
if(datatype(fdate,'W') & datatype(fsize,'W') & datatype(fdnls,W)) then
do
drop CD.
CD.MDAY = left(fdate,2)
CD.MONTH = substr(fdate,3,2)
CD.YEAR = right(fdate,2)
if CD.YEAR < 78 then CD.YEAR = CD.YEAR + 2000
else CD.YEAR = CD.YEAR + 1900
DATE2AMIGA CD
convfdate = result
say left(fname, 18) fdate right(fsize, 7) right(fdnls, 3) strip(fdescr)
drop BRFILE.
BRFILE.NAME = fname
BRFILE.DATE = convfdate
BRFILE.SIZE = fsize
BRFILE.DOWNLOADS = fdnls
if fdescr ~= '' then
do
BRFILE.DESCRIPTION.COUNT = 1
BRFILE.DESCRIPTION.1 = strip(fdescr)
end
WRITEBRFILE '"' || ARGS.BBSNAME || '"' farea stem BRFILE
end
end
end
end
ERROR:
HALT:
BREAK_C:
if(rc ~= 0) then
do
say 'Error' rc 'in line' SIGL ':' BBSREAD.LASTERROR
end
BUFMODE ENDCOPYBACK /* Disable copyback buffer mode */
exit